package Plate;

import java.lang.reflect.Array;
import java.sql.SQLOutput;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.Comparator;

public class Doudizhu {
    ArrayList list = new ArrayList();

    // 初始化54张扑克牌
    public void init() {
        String[] pai = { "3", "4", "5", "6", "7", "8", "9", "10", "J", "Q", "K","A", "2"};
        for (int i = 0; i < 13; i++) {
            list.add(new Card("♠",pai[i]));
            list.add(new Card("♥",pai[i]));
            list.add(new Card("♣",pai[i]));
            list.add(new Card("♠",pai[i]));
            list.add(new Card("♦",pai[i]));
        }
        list.add("大王");
        list.add("小王");
        System.out.println(list);
    }

    // 洗牌
    public void xipai() {
        Collections.shuffle(list);
        System.out.println(list);
    }

    // 发牌
    public void fapai() {
        System.out.println("翠花" + list.subList(0, 17));
        System.out.println("熊大" + list.subList(17, 34));
        System.out.println("熊二" + list.subList(34, 51));
        System.out.println("底牌" + list.subList(51, 54));


    }

    public static void main(String[] args) {
        Doudizhu doudizhu = new Doudizhu();
        doudizhu.init();
        doudizhu.xipai();
        doudizhu.fapai();

    }
}
